<template>
  <div :style="{ height: tableY + 75 + 'px'}" style="margin-bottom: 40px;">
    <div class="margin-bottom-xs">
      <a-button
          type="danger"
          icon="delete"
          @click="handleSub($refs.table.selectedRowKeys)"
      >
        {{$ct("delete","删除")}}
      </a-button>
      <a-button class="cu-btn-danger" type="link" @click="() => $emit('clearAll')">一键清空</a-button>
    </div>
    <!--	table	 -->
    <DataGrid
        ref="table"
        :columns="columns"
        :url="url"
        :queryParam="queryParam"
        rowKey="uuid"
        :format-conditions="true"
        :pageSize="20"
        :scroll="{
              y:tableY
          }"
    >
        <span slot="renderUserNameId" slot-scope="{ text, record, index }">
					运行日志
        </span>

    </DataGrid>
  </div>
</template>

<!--script-->
<script>

//数据表格组件
import {DataGrid} from "@/components";
//方法封装
import {dataGridMixin} from "@/mixins/dataGridMixin";

export default {
  name: "Table",
  components: {DataGrid},
  mixins: [dataGridMixin],
  filters: {},
  props: {
    tableY: 0,
    queryParam: {
      type: Object,
      defaultValue: () => {
        return {
          operationType: 'requestLog.04'
        }
      }
    },// 查询参数
  },
  data() {
    return {
      columns: [
        {
          title: '日志类型',
          width: 120,
          dataIndex: 'operationType',
          scopedSlots: {
            customRender: 'renderUserNameId'
          }
        },
        {
          title: '对象名称',
          width: 120,
          dataIndex: 'operationModular',
        },
        {
          title: '操作时间',
          dataIndex: 'createTime',
        },
        {
          title: 'IP地址',
          dataIndex: 'operationIp',
        },{
          title: '操作结果',
          dataIndex: 'operationContent',
        }
      ],
      visible: false,
      confirmLoading: false,
      mdl: null,
      url: {
        getPageSet: '/system/sysOperationLog/getPageSet',
        deleteBatch: '/system/sysOperationLog/deleteBatch'
      },
      startTime: ''
    };
  },
  mounted() {
  },
  methods: {

    startTimeOnChange(val) {
      this.queryParam.startTime = val.join(',')
    }
  },
};
</script>

<!--style-->
<style scoped lang="less">
.table {
  background-color: @base-bg-color;
  padding: 24px;
}
</style>
